<?php

App::uses('AppModel', 'Model');

/**
 * Block Region Model
 * 
 * PHP versions 5
 * CAKEPHP versions 2.x
 * 
 * Green CMS - Content Management System and Framework Powerfull by Cakephp
 * Copyright 2012, GREEN GLOBAL CO., LTD (toancauxanh.vn)
 * 
 * CakePHP(tm) :  Rapid Development Framework (http://www.cakephp.org)
 * Copyright 2005-2011, Cake Software Foundation, Inc. (http://www.cakefoundation.org)
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @author        Technology Lab No.I <tech1@toancauxanh.vn>
 * @link          
 * @package       Block.Model
 * @since         Green v 1.0
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 *
 * @property Block $Block
 */
class BlockRegion extends AppModel {

    /**
     * Display field
     *
     * @var string
     */
    public $displayField = 'region';

    /**
     * Name of the validation string domain to use when translating validation errors.
     *
     * @var string
     */
    public $validationDomain = 'system';

    /**
     * Validation rules.
     *
     * @var array
     */
    public $validate = array(
        'block_id' => array(
            'required' => array(
                'rule' => '//',
                'on' => 'create',
                'required' => true,
                'message' => 'This field is not blank!',
            ),
            'notempty' => array(
                'allowEmpty' => false,
                'rule' => 'notempty',
                'message' => 'This is a required information'
            )
        ),
        'theme' => array(
            'required' => array(
                'rule' => '//',
                'on' => 'create',
                'required' => true,
                'message' => 'This field is not blank!',
            ),
            'maxLength' => array(
                'allowEmpty' => false,
                'rule' => array('maxLength', 64),
                'message' => 'Theme name  is a required information and must be no larger than 64 characters long.'
            )
        ),
        'region' => array(
            'required' => array(
                'rule' => '//',
                'on' => 'create',
                'required' => true,
                'message' => 'This field is not blank!',
            ),
            'maxLength' => array(
                'allowEmpty' => false,
                'rule' => array('maxLength', 64),
                'message' => 'Region name  is a required information and must be no larger than 64 characters long.'
            )
        )
    );

    //The Associations below have been created with all possible keys, those that are not needed can be removed

    /**
     * belongsTo associations.
     *
     * @var array
     */
    public $belongsTo = array(
        'Block' => array(
            'className' => 'Block.Block',
            'foreignKey' => 'block_id',
            'conditions' => '',
            'fields' => '',
            'order' => '',
            'counterCache' => ''
        )
    );

}

?>